<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" isELIgnored="false" import="java.util.*"
	pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix='security'
	uri='http://www.springframework.org/security/tags'%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/style_new.css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(function() {
	//对于首页的下拉选项【首页】有变动，不再出现下拉了，所以js改动一下
	var tree = $("#yuyunav");
  	var shouye={};
	var urls="<%=request.getContextPath()%>"+"/auth/Menu/findAllMenuByUser.koala";
	 $.ajax({
			url:urls,
			type : "POST",
			cache : false, 
			async : true,
		    dataType:'json',
		    success:function(data){
		    	$.each(data.data,function(idx,e){
		    		var li='';
		    		if("首页" == e.name){
		    			tree.append('<li ><a href="javascript:void(0)" style="cursor:pointer" onclick=gogogo("'+e.children[0].identifier+'?code='+e.desc+'")>'+e.name+'</a></li>');
		    		}else{
		    			$.each(e.children, function(i,menu){
		    				var url =menu.identifier;
		    				 if(/=/.test(url)){
			   					 url=url+'&code='+menu.desc;
			   				 }else{
			   					 url=url+'?code='+menu.desc;
			   				 }
		    				 li += '<li><a onclick=gogogo("'+url+'") style="cursor:pointer">'+menu.name+'</a></li>';
		    			});
		    			 tree.append('<li ><a href="#" style="cursor:pointer">'+e.name+'</a><ul>'+li+'</ul></li>');
		    		}
		    		
		    	}); 
		    },
		    error:function(){ 
		    	alert("请先登录");
		    },
	 });

  
  $("#currentDate").text(currentDate());
})

function gogogo(url){
	location.href = url.indexOf("/")==0 ? '<%=request.getContextPath()%>'+url : '<%=request.getContextPath()%>/' + url;
	}

	function currentDate() {
		var now = new Date();
		var year = now.getFullYear();
		var month = now.getMonth() + 1;
		var day = now.getDate();

		var today = year + "-";
		if (month < 10)
			today += "0";
		today += month + "-";
		if (day < 10)
			today += "0";
		today += day;
		return (today);
	}
</script>
<div class="top_banner">
	<div class="main_max">
		<div class="logo_tt"></div>
		<div class="welcome_bgs">
			
			<s:i18n name="treelist"> 
  							<s:text name="treelist.todatyIs"></s:text>
			</s:i18n>
			<span id="currentDate" style="width: 70px;" /></span>&nbsp;&nbsp;
			<security:authentication property="principal.username" />
			，<s:i18n name="treelist"> 
  							<s:text name="treelist.hi"></s:text>
			</s:i18n>！
		</div>
		<div class="quite">
			<a href="http://www.foreveross.com" target="_blank"><s:i18n name="treelist"> 
  							<s:text name="treelist.aboutUs"></s:text>
			</s:i18n></a>   <a
				href="http://www.foreveross.com" target="_blank"><s:i18n name="treelist"> 
  							<s:text name="treelist.help"></s:text>
			</s:i18n></a>    <a
				href="<%=request.getContextPath()%>/j_spring_security_logout"><s:i18n name="treelist"> 
  							<s:text name="treelist.exit"></s:text>
			</s:i18n></a>
		</div>
	</div>
	<div class="navbox_out">
		<ul id="yuyunav"></ul>
	</div>
</div>

